TARDIS Analysis Tool Documentation 📊¶

This tool is designed to analyze and compare TARDIS regression data across different commits. It provides visualization capabilities using Plotly for:

  1. Direct Spectrum Comparison: Compares the luminosity vs wavelength plots across different commits
  2. Residual Analysis: Shows the fractional differences between spectra from different commits

Imports 📥¶

In [1]:
import os
from git import Repo
from tardis_analysis import (
    process_commits, load_h5_data, SPECTRUM_KEYS, PLOTLY_COLORS,
    plot_all_commits_plotly, plot_residuals_plotly, commits
)
import plotly.graph_objects as go
from plotly.subplots import make_subplots

Configuration Settings ⚙️¶

The configuration dictionary defines essential parameters for the analysis:

  • Repository Paths:

    • tardis_repo: Path to TARDIS repository
    • regression_data_repo: Path to regression data repository
  • Parameters:

    • branch: Target branch for analysis (default: "master")
    • n: Number of commits to analyze (default: 2), will be ignored if commits list is provided
    • target_file: Path to HDF5 file containing spectrum solver test data
    • save_plots: Boolean flag to enable plot saving (default: True)
    • gap: Number of days between each commit
    • info: If True, returns a DataFrame with hash, author, and message; otherwise returns a list of hashes
  • Optional Parameters:

    • commits: List of specific commit hashes (commented out by default)
    • output_dir: Custom output directory (defaults to "comparison_plots" in tardis_repo if None)
In [2]:
commits.calculate_commits(n=10, gap=0, info=True)
Out[2]:
hash author message date
0 f5f637b4e06e3bb85f4c8163c69aede5ccfada57 Atharva Arya Workflow Label Pipeline and Fixes (#3016)\n\n*... 2025-03-20 20:31:02
1 5c20b5f038152d19cdfcf2ae9c384989fd518050 Joshua Shields add final integrated tau property to v_inner w... 2025-03-20 20:30:01
2 be54e6d0330f0f52a56a8c5e0e8ff83fb26355af Andrew Fullard Fix docs 2025-03-20 20:03:22
3 41effababbdc02ce514b957253ea0ba7a69e1b33 Erin Visser v_inner_solver store plasma state fxn (#2981)\... 2025-03-20 19:01:32
4 df376c14e57b37c62d5f5584354695faa37666cf Andrew Fullard Pass kwarg through correctly 2025-03-19 20:32:26
5 6f40a6002ba2bca2e1c8233319481d67ba0dbbdb tardis-bot Post-release 2025.03.19 (#3019)\n\nAutomated c... 2025-03-19 20:30:43
6 9d30f345761d2039385cb280e0d817ec09e41e5a Andrew Fullard Fix workflows for Connector 2025-03-18 03:14:24
7 73dc5352075b0db50bd8b77616c9125ce29d0fdb tardis-bot Post-release 2025.03.16 (#3014)\n\nAutomated c... 2025-03-17 14:23:27
8 e1b76424a28da8531af3b707d7fea4804ae81edd KasukabeDefenceForce Add sdec visualisation notebook (#2968)\n\n* a... 2025-03-11 18:49:03
9 74b9646bf936b508817d13138805c28ed73bbd33 Atharva Arya Document `LFS-cache` workflow and the `setup-l... 2025-03-10 20:11:47
In [3]:
config = {
    "tardis_repo": "/home/riddhi/workspace/tardis-main/tardis",
    "regression_data_repo": "/home/riddhi/workspace/tardis-main/tardis-regression-data",
    "branch": "master",
    "n": 3,
    "target_file": "tardis/spectrum/tests/test_spectrum_solver/test_spectrum_solver/TestSpectrumSolver.h5",
    "output_dir": None,
    # "commits": ["300e565e83112528faaa76e970057ffb1b13f743", "2a06fdfb60190bbd9b49ff572d78772607138660", "2d775dcd1c486227532f537fc41066e942000e56"],  # Uncomment for specific commits
    "commits": commits.calculate_commits(n=10, gap=0, info=False), #Uncomment for n commits with custom gap
    "save_plots": True
}

if config["output_dir"] is None:
    config["output_dir"] = os.path.join(config["tardis_repo"], "comparison_plots")

Process Commits ↻¶

This code processes either specific commits or the latest n commits from the TARDIS repository. For each commit, it runs regression tests, generates reference data, and stores the results in the regression data repository. The function returns the processed commit hashes, corresponding regression commit hashes, original HEAD position, and the target file path.

It handles both specific commit inputs (via commits parameter) and default behavior (latest n commits), ensuring proper repository state management throughout the process.

In [4]:
if config.get("commits"):
    processed_commits, regression_commits, original_head, target_file_path = process_commits(
        config["tardis_repo"], config["regression_data_repo"], 
        config["branch"], config["target_file"], 
        commits_input=config["commits"]
    )
else:
    processed_commits, regression_commits, original_head, target_file_path = process_commits(
        config["tardis_repo"], config["regression_data_repo"], 
        config["branch"], config["target_file"], 
        n=config["n"]
    )
Original HEAD of regression data repo: cb399cbf6ef52a5a65a47ee09607a946b47c93ca
Processing commit 1/10: f5f637b4e06e3bb85f4c8163c69aede5ccfada57
Running pytest command: python -m pytest tardis/spectrum/tests/test_spectrum_solver.py --tardis-regression-data=/home/riddhi/workspace/tardis-main/tardis-regression-data --generate-reference -x
Current directory: /home/riddhi/workspace/tardis-main/tardis
Pytest stdout:
============================= test session starts ==============================
platform linux -- Python 3.12.4, pytest-8.2.2, pluggy-1.5.0
rootdir: /home/riddhi/workspace/tardis-main/tardis
configfile: pyproject.toml
plugins: anyio-4.4.0, doctestplus-1.2.1, cov-5.0.0, html-4.1.1, metadata-3.1.1
collected 4 items

tardis/spectrum/tests/test_spectrum_solver.py ssss                       [100%]

=============================== warnings summary ===============================
tardis/io/configuration/config_validator.py:6
tardis/io/configuration/config_validator.py:6
  /home/riddhi/workspace/tardis-main/tardis/tardis/io/configuration/config_validator.py:6: DeprecationWarning:
  
  jsonschema.RefResolver is deprecated as of v4.18.0, in favor of the https://github.com/python-jsonschema/referencing library, which provides more compliant referencing behavior as well as more flexible APIs for customization. A future release will remove RefResolver. Please file a feature request (on referencing) if you are missing an API for the kind of customization you need.

../../../miniforge3/envs/tardis/lib/python3.12/site-packages/jupyter_client/connect.py:22
  /home/riddhi/miniforge3/envs/tardis/lib/python3.12/site-packages/jupyter_client/connect.py:22: DeprecationWarning:
  
  Jupyter is migrating its paths to use standard platformdirs
  given by the platformdirs library.  To remove this warning and
  see the appropriate new directories, set the environment variable
  `JUPYTER_PLATFORM_DIRS=1` and then run `jupyter --paths`.
  The use of platformdirs will be the default in `jupyter_core` v6

tardis/spectrum/tests/test_spectrum_solver.py::TestSpectrumSolver::test_initialization
  /home/riddhi/workspace/tardis-main/tardis/tardis/transport/montecarlo/montecarlo_main_loop.py:123: NumbaTypeSafetyWarning:
  
  unsafe cast from uint64 to int64. Precision may be lost.

tardis/spectrum/tests/test_spectrum_solver.py::TestSpectrumSolver::test_initialization
  /home/riddhi/workspace/tardis-main/tardis/tardis/io/util.py:289: PerformanceWarning:
  
  
  your performance may suffer as PyTables will pickle object types that it cannot
  map directly to c-types [inferred_type->mixed,key->block0_values] [items->Index([0], dtype='int64')]

tardis/spectrum/tests/test_spectrum_solver.py::TestSpectrumSolver::test_initialization
  /home/riddhi/workspace/tardis-main/tardis/tardis/io/util.py:276: PerformanceWarning:
  
  
  your performance may suffer as PyTables will pickle object types that it cannot
  map directly to c-types [inferred_type->mixed,key->block0_values] [items->Index([0], dtype='int64')]

tardis/spectrum/tests/test_spectrum_solver.py::TestSpectrumSolver::test_initialization
  /home/riddhi/workspace/tardis-main/tardis/tardis/io/util.py:292: PerformanceWarning:
  
  
  your performance may suffer as PyTables will pickle object types that it cannot
  map directly to c-types [inferred_type->mixed,key->values] [items->None]

tardis/spectrum/tests/test_spectrum_solver.py::TestSpectrumSolver::test_initialization
  /home/riddhi/workspace/tardis-main/tardis/tardis/spectrum/formal_integral.py:398: UserWarning:
  
  The number of interpolate_shells was not specified. The value was set to 80.

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================== 4 skipped, 8 warnings in 95.48s (0:01:35) ===================

Pytest stderr:

Processing commit 2/10: 5c20b5f038152d19cdfcf2ae9c384989fd518050
Running pytest command: python -m pytest tardis/spectrum/tests/test_spectrum_solver.py --tardis-regression-data=/home/riddhi/workspace/tardis-main/tardis-regression-data --generate-reference -x
Current directory: /home/riddhi/workspace/tardis-main/tardis
Pytest stdout:
============================= test session starts ==============================
platform linux -- Python 3.12.4, pytest-8.2.2, pluggy-1.5.0
rootdir: /home/riddhi/workspace/tardis-main/tardis
configfile: pyproject.toml
plugins: anyio-4.4.0, doctestplus-1.2.1, cov-5.0.0, html-4.1.1, metadata-3.1.1
collected 4 items

tardis/spectrum/tests/test_spectrum_solver.py ssss                       [100%]

=============================== warnings summary ===============================
tardis/io/configuration/config_validator.py:6
tardis/io/configuration/config_validator.py:6
  /home/riddhi/workspace/tardis-main/tardis/tardis/io/configuration/config_validator.py:6: DeprecationWarning:
  
  jsonschema.RefResolver is deprecated as of v4.18.0, in favor of the https://github.com/python-jsonschema/referencing library, which provides more compliant referencing behavior as well as more flexible APIs for customization. A future release will remove RefResolver. Please file a feature request (on referencing) if you are missing an API for the kind of customization you need.

../../../miniforge3/envs/tardis/lib/python3.12/site-packages/jupyter_client/connect.py:22
  /home/riddhi/miniforge3/envs/tardis/lib/python3.12/site-packages/jupyter_client/connect.py:22: DeprecationWarning:
  
  Jupyter is migrating its paths to use standard platformdirs
  given by the platformdirs library.  To remove this warning and
  see the appropriate new directories, set the environment variable
  `JUPYTER_PLATFORM_DIRS=1` and then run `jupyter --paths`.
  The use of platformdirs will be the default in `jupyter_core` v6

tardis/spectrum/tests/test_spectrum_solver.py::TestSpectrumSolver::test_initialization
  /home/riddhi/workspace/tardis-main/tardis/tardis/transport/montecarlo/montecarlo_main_loop.py:123: NumbaTypeSafetyWarning:
  
  unsafe cast from uint64 to int64. Precision may be lost.

tardis/spectrum/tests/test_spectrum_solver.py::TestSpectrumSolver::test_initialization
  /home/riddhi/workspace/tardis-main/tardis/tardis/io/util.py:289: PerformanceWarning:
  
  
  your performance may suffer as PyTables will pickle object types that it cannot
  map directly to c-types [inferred_type->mixed,key->block0_values] [items->Index([0], dtype='int64')]

tardis/spectrum/tests/test_spectrum_solver.py::TestSpectrumSolver::test_initialization
  /home/riddhi/workspace/tardis-main/tardis/tardis/io/util.py:276: PerformanceWarning:
  
  
  your performance may suffer as PyTables will pickle object types that it cannot
  map directly to c-types [inferred_type->mixed,key->block0_values] [items->Index([0], dtype='int64')]

tardis/spectrum/tests/test_spectrum_solver.py::TestSpectrumSolver::test_initialization
  /home/riddhi/workspace/tardis-main/tardis/tardis/io/util.py:292: PerformanceWarning:
  
  
  your performance may suffer as PyTables will pickle object types that it cannot
  map directly to c-types [inferred_type->mixed,key->values] [items->None]

tardis/spectrum/tests/test_spectrum_solver.py::TestSpectrumSolver::test_initialization
  /home/riddhi/workspace/tardis-main/tardis/tardis/spectrum/formal_integral.py:398: UserWarning:
  
  The number of interpolate_shells was not specified. The value was set to 80.

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================== 4 skipped, 8 warnings in 93.84s (0:01:33) ===================

Pytest stderr:

Processing commit 3/10: be54e6d0330f0f52a56a8c5e0e8ff83fb26355af
Running pytest command: python -m pytest tardis/spectrum/tests/test_spectrum_solver.py --tardis-regression-data=/home/riddhi/workspace/tardis-main/tardis-regression-data --generate-reference -x
Current directory: /home/riddhi/workspace/tardis-main/tardis
Pytest stdout:
============================= test session starts ==============================
platform linux -- Python 3.12.4, pytest-8.2.2, pluggy-1.5.0
rootdir: /home/riddhi/workspace/tardis-main/tardis
configfile: pyproject.toml
plugins: anyio-4.4.0, doctestplus-1.2.1, cov-5.0.0, html-4.1.1, metadata-3.1.1
collected 4 items

tardis/spectrum/tests/test_spectrum_solver.py ssss                       [100%]

=============================== warnings summary ===============================
tardis/io/configuration/config_validator.py:6
tardis/io/configuration/config_validator.py:6
  /home/riddhi/workspace/tardis-main/tardis/tardis/io/configuration/config_validator.py:6: DeprecationWarning:
  
  jsonschema.RefResolver is deprecated as of v4.18.0, in favor of the https://github.com/python-jsonschema/referencing library, which provides more compliant referencing behavior as well as more flexible APIs for customization. A future release will remove RefResolver. Please file a feature request (on referencing) if you are missing an API for the kind of customization you need.

../../../miniforge3/envs/tardis/lib/python3.12/site-packages/jupyter_client/connect.py:22
  /home/riddhi/miniforge3/envs/tardis/lib/python3.12/site-packages/jupyter_client/connect.py:22: DeprecationWarning:
  
  Jupyter is migrating its paths to use standard platformdirs
  given by the platformdirs library.  To remove this warning and
  see the appropriate new directories, set the environment variable
  `JUPYTER_PLATFORM_DIRS=1` and then run `jupyter --paths`.
  The use of platformdirs will be the default in `jupyter_core` v6

tardis/spectrum/tests/test_spectrum_solver.py::TestSpectrumSolver::test_initialization
  /home/riddhi/workspace/tardis-main/tardis/tardis/transport/montecarlo/montecarlo_main_loop.py:123: NumbaTypeSafetyWarning:
  
  unsafe cast from uint64 to int64. Precision may be lost.

tardis/spectrum/tests/test_spectrum_solver.py::TestSpectrumSolver::test_initialization
  /home/riddhi/workspace/tardis-main/tardis/tardis/io/util.py:289: PerformanceWarning:
  
  
  your performance may suffer as PyTables will pickle object types that it cannot
  map directly to c-types [inferred_type->mixed,key->block0_values] [items->Index([0], dtype='int64')]

tardis/spectrum/tests/test_spectrum_solver.py::TestSpectrumSolver::test_initialization
  /home/riddhi/workspace/tardis-main/tardis/tardis/io/util.py:276: PerformanceWarning:
  
  
  your performance may suffer as PyTables will pickle object types that it cannot
  map directly to c-types [inferred_type->mixed,key->block0_values] [items->Index([0], dtype='int64')]

tardis/spectrum/tests/test_spectrum_solver.py::TestSpectrumSolver::test_initialization
  /home/riddhi/workspace/tardis-main/tardis/tardis/io/util.py:292: PerformanceWarning:
  
  
  your performance may suffer as PyTables will pickle object types that it cannot
  map directly to c-types [inferred_type->mixed,key->values] [items->None]

tardis/spectrum/tests/test_spectrum_solver.py::TestSpectrumSolver::test_initialization
  /home/riddhi/workspace/tardis-main/tardis/tardis/spectrum/formal_integral.py:398: UserWarning:
  
  The number of interpolate_shells was not specified. The value was set to 80.

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================== 4 skipped, 8 warnings in 92.95s (0:01:32) ===================

Pytest stderr:

Processing commit 4/10: 41effababbdc02ce514b957253ea0ba7a69e1b33
Running pytest command: python -m pytest tardis/spectrum/tests/test_spectrum_solver.py --tardis-regression-data=/home/riddhi/workspace/tardis-main/tardis-regression-data --generate-reference -x
Current directory: /home/riddhi/workspace/tardis-main/tardis
Pytest stdout:
============================= test session starts ==============================
platform linux -- Python 3.12.4, pytest-8.2.2, pluggy-1.5.0
rootdir: /home/riddhi/workspace/tardis-main/tardis
configfile: pyproject.toml
plugins: anyio-4.4.0, doctestplus-1.2.1, cov-5.0.0, html-4.1.1, metadata-3.1.1
collected 4 items

tardis/spectrum/tests/test_spectrum_solver.py ssss                       [100%]

=============================== warnings summary ===============================
tardis/io/configuration/config_validator.py:6
tardis/io/configuration/config_validator.py:6
  /home/riddhi/workspace/tardis-main/tardis/tardis/io/configuration/config_validator.py:6: DeprecationWarning:
  
  jsonschema.RefResolver is deprecated as of v4.18.0, in favor of the https://github.com/python-jsonschema/referencing library, which provides more compliant referencing behavior as well as more flexible APIs for customization. A future release will remove RefResolver. Please file a feature request (on referencing) if you are missing an API for the kind of customization you need.

../../../miniforge3/envs/tardis/lib/python3.12/site-packages/jupyter_client/connect.py:22
  /home/riddhi/miniforge3/envs/tardis/lib/python3.12/site-packages/jupyter_client/connect.py:22: DeprecationWarning:
  
  Jupyter is migrating its paths to use standard platformdirs
  given by the platformdirs library.  To remove this warning and
  see the appropriate new directories, set the environment variable
  `JUPYTER_PLATFORM_DIRS=1` and then run `jupyter --paths`.
  The use of platformdirs will be the default in `jupyter_core` v6

tardis/spectrum/tests/test_spectrum_solver.py::TestSpectrumSolver::test_initialization
  /home/riddhi/workspace/tardis-main/tardis/tardis/transport/montecarlo/montecarlo_main_loop.py:123: NumbaTypeSafetyWarning:
  
  unsafe cast from uint64 to int64. Precision may be lost.

tardis/spectrum/tests/test_spectrum_solver.py::TestSpectrumSolver::test_initialization
  /home/riddhi/workspace/tardis-main/tardis/tardis/io/util.py:289: PerformanceWarning:
  
  
  your performance may suffer as PyTables will pickle object types that it cannot
  map directly to c-types [inferred_type->mixed,key->block0_values] [items->Index([0], dtype='int64')]

tardis/spectrum/tests/test_spectrum_solver.py::TestSpectrumSolver::test_initialization
  /home/riddhi/workspace/tardis-main/tardis/tardis/io/util.py:276: PerformanceWarning:
  
  
  your performance may suffer as PyTables will pickle object types that it cannot
  map directly to c-types [inferred_type->mixed,key->block0_values] [items->Index([0], dtype='int64')]

tardis/spectrum/tests/test_spectrum_solver.py::TestSpectrumSolver::test_initialization
  /home/riddhi/workspace/tardis-main/tardis/tardis/io/util.py:292: PerformanceWarning:
  
  
  your performance may suffer as PyTables will pickle object types that it cannot
  map directly to c-types [inferred_type->mixed,key->values] [items->None]

tardis/spectrum/tests/test_spectrum_solver.py::TestSpectrumSolver::test_initialization
  /home/riddhi/workspace/tardis-main/tardis/tardis/spectrum/formal_integral.py:398: UserWarning:
  
  The number of interpolate_shells was not specified. The value was set to 80.

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================== 4 skipped, 8 warnings in 94.79s (0:01:34) ===================

Pytest stderr:

Processing commit 5/10: df376c14e57b37c62d5f5584354695faa37666cf
Running pytest command: python -m pytest tardis/spectrum/tests/test_spectrum_solver.py --tardis-regression-data=/home/riddhi/workspace/tardis-main/tardis-regression-data --generate-reference -x
Current directory: /home/riddhi/workspace/tardis-main/tardis
Pytest stdout:
============================= test session starts ==============================
platform linux -- Python 3.12.4, pytest-8.2.2, pluggy-1.5.0
rootdir: /home/riddhi/workspace/tardis-main/tardis
configfile: pyproject.toml
plugins: anyio-4.4.0, doctestplus-1.2.1, cov-5.0.0, html-4.1.1, metadata-3.1.1
collected 4 items

tardis/spectrum/tests/test_spectrum_solver.py ssss                       [100%]

=============================== warnings summary ===============================
tardis/io/configuration/config_validator.py:6
tardis/io/configuration/config_validator.py:6
  /home/riddhi/workspace/tardis-main/tardis/tardis/io/configuration/config_validator.py:6: DeprecationWarning:
  
  jsonschema.RefResolver is deprecated as of v4.18.0, in favor of the https://github.com/python-jsonschema/referencing library, which provides more compliant referencing behavior as well as more flexible APIs for customization. A future release will remove RefResolver. Please file a feature request (on referencing) if you are missing an API for the kind of customization you need.

../../../miniforge3/envs/tardis/lib/python3.12/site-packages/jupyter_client/connect.py:22
  /home/riddhi/miniforge3/envs/tardis/lib/python3.12/site-packages/jupyter_client/connect.py:22: DeprecationWarning:
  
  Jupyter is migrating its paths to use standard platformdirs
  given by the platformdirs library.  To remove this warning and
  see the appropriate new directories, set the environment variable
  `JUPYTER_PLATFORM_DIRS=1` and then run `jupyter --paths`.
  The use of platformdirs will be the default in `jupyter_core` v6

tardis/spectrum/tests/test_spectrum_solver.py::TestSpectrumSolver::test_initialization
  /home/riddhi/workspace/tardis-main/tardis/tardis/transport/montecarlo/montecarlo_main_loop.py:123: NumbaTypeSafetyWarning:
  
  unsafe cast from uint64 to int64. Precision may be lost.

tardis/spectrum/tests/test_spectrum_solver.py::TestSpectrumSolver::test_initialization
  /home/riddhi/workspace/tardis-main/tardis/tardis/io/util.py:289: PerformanceWarning:
  
  
  your performance may suffer as PyTables will pickle object types that it cannot
  map directly to c-types [inferred_type->mixed,key->block0_values] [items->Index([0], dtype='int64')]

tardis/spectrum/tests/test_spectrum_solver.py::TestSpectrumSolver::test_initialization
  /home/riddhi/workspace/tardis-main/tardis/tardis/io/util.py:276: PerformanceWarning:
  
  
  your performance may suffer as PyTables will pickle object types that it cannot
  map directly to c-types [inferred_type->mixed,key->block0_values] [items->Index([0], dtype='int64')]

tardis/spectrum/tests/test_spectrum_solver.py::TestSpectrumSolver::test_initialization
  /home/riddhi/workspace/tardis-main/tardis/tardis/io/util.py:292: PerformanceWarning:
  
  
  your performance may suffer as PyTables will pickle object types that it cannot
  map directly to c-types [inferred_type->mixed,key->values] [items->None]

tardis/spectrum/tests/test_spectrum_solver.py::TestSpectrumSolver::test_initialization
  /home/riddhi/workspace/tardis-main/tardis/tardis/spectrum/formal_integral.py:398: UserWarning:
  
  The number of interpolate_shells was not specified. The value was set to 80.

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================== 4 skipped, 8 warnings in 93.91s (0:01:33) ===================

Pytest stderr:

Processing commit 6/10: 6f40a6002ba2bca2e1c8233319481d67ba0dbbdb
Running pytest command: python -m pytest tardis/spectrum/tests/test_spectrum_solver.py --tardis-regression-data=/home/riddhi/workspace/tardis-main/tardis-regression-data --generate-reference -x
Current directory: /home/riddhi/workspace/tardis-main/tardis
Pytest stdout:
============================= test session starts ==============================
platform linux -- Python 3.12.4, pytest-8.2.2, pluggy-1.5.0
rootdir: /home/riddhi/workspace/tardis-main/tardis
configfile: pyproject.toml
plugins: anyio-4.4.0, doctestplus-1.2.1, cov-5.0.0, html-4.1.1, metadata-3.1.1
collected 4 items

tardis/spectrum/tests/test_spectrum_solver.py ssss                       [100%]

=============================== warnings summary ===============================
tardis/io/configuration/config_validator.py:6
tardis/io/configuration/config_validator.py:6
  /home/riddhi/workspace/tardis-main/tardis/tardis/io/configuration/config_validator.py:6: DeprecationWarning:
  
  jsonschema.RefResolver is deprecated as of v4.18.0, in favor of the https://github.com/python-jsonschema/referencing library, which provides more compliant referencing behavior as well as more flexible APIs for customization. A future release will remove RefResolver. Please file a feature request (on referencing) if you are missing an API for the kind of customization you need.

../../../miniforge3/envs/tardis/lib/python3.12/site-packages/jupyter_client/connect.py:22
  /home/riddhi/miniforge3/envs/tardis/lib/python3.12/site-packages/jupyter_client/connect.py:22: DeprecationWarning:
  
  Jupyter is migrating its paths to use standard platformdirs
  given by the platformdirs library.  To remove this warning and
  see the appropriate new directories, set the environment variable
  `JUPYTER_PLATFORM_DIRS=1` and then run `jupyter --paths`.
  The use of platformdirs will be the default in `jupyter_core` v6

tardis/spectrum/tests/test_spectrum_solver.py::TestSpectrumSolver::test_initialization
  /home/riddhi/workspace/tardis-main/tardis/tardis/transport/montecarlo/montecarlo_main_loop.py:123: NumbaTypeSafetyWarning:
  
  unsafe cast from uint64 to int64. Precision may be lost.

tardis/spectrum/tests/test_spectrum_solver.py::TestSpectrumSolver::test_initialization
  /home/riddhi/workspace/tardis-main/tardis/tardis/io/util.py:289: PerformanceWarning:
  
  
  your performance may suffer as PyTables will pickle object types that it cannot
  map directly to c-types [inferred_type->mixed,key->block0_values] [items->Index([0], dtype='int64')]

tardis/spectrum/tests/test_spectrum_solver.py::TestSpectrumSolver::test_initialization
  /home/riddhi/workspace/tardis-main/tardis/tardis/io/util.py:276: PerformanceWarning:
  
  
  your performance may suffer as PyTables will pickle object types that it cannot
  map directly to c-types [inferred_type->mixed,key->block0_values] [items->Index([0], dtype='int64')]

tardis/spectrum/tests/test_spectrum_solver.py::TestSpectrumSolver::test_initialization
  /home/riddhi/workspace/tardis-main/tardis/tardis/io/util.py:292: PerformanceWarning:
  
  
  your performance may suffer as PyTables will pickle object types that it cannot
  map directly to c-types [inferred_type->mixed,key->values] [items->None]

tardis/spectrum/tests/test_spectrum_solver.py::TestSpectrumSolver::test_initialization
  /home/riddhi/workspace/tardis-main/tardis/tardis/spectrum/formal_integral.py:398: UserWarning:
  
  The number of interpolate_shells was not specified. The value was set to 80.

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================== 4 skipped, 8 warnings in 94.48s (0:01:34) ===================

Pytest stderr:

Processing commit 7/10: 9d30f345761d2039385cb280e0d817ec09e41e5a
Running pytest command: python -m pytest tardis/spectrum/tests/test_spectrum_solver.py --tardis-regression-data=/home/riddhi/workspace/tardis-main/tardis-regression-data --generate-reference -x
Current directory: /home/riddhi/workspace/tardis-main/tardis
Pytest stdout:
============================= test session starts ==============================
platform linux -- Python 3.12.4, pytest-8.2.2, pluggy-1.5.0
rootdir: /home/riddhi/workspace/tardis-main/tardis
configfile: pyproject.toml
plugins: anyio-4.4.0, doctestplus-1.2.1, cov-5.0.0, html-4.1.1, metadata-3.1.1
collected 4 items

tardis/spectrum/tests/test_spectrum_solver.py ssss                       [100%]

=============================== warnings summary ===============================
tardis/io/configuration/config_validator.py:6
tardis/io/configuration/config_validator.py:6
  /home/riddhi/workspace/tardis-main/tardis/tardis/io/configuration/config_validator.py:6: DeprecationWarning:
  
  jsonschema.RefResolver is deprecated as of v4.18.0, in favor of the https://github.com/python-jsonschema/referencing library, which provides more compliant referencing behavior as well as more flexible APIs for customization. A future release will remove RefResolver. Please file a feature request (on referencing) if you are missing an API for the kind of customization you need.

../../../miniforge3/envs/tardis/lib/python3.12/site-packages/jupyter_client/connect.py:22
  /home/riddhi/miniforge3/envs/tardis/lib/python3.12/site-packages/jupyter_client/connect.py:22: DeprecationWarning:
  
  Jupyter is migrating its paths to use standard platformdirs
  given by the platformdirs library.  To remove this warning and
  see the appropriate new directories, set the environment variable
  `JUPYTER_PLATFORM_DIRS=1` and then run `jupyter --paths`.
  The use of platformdirs will be the default in `jupyter_core` v6

tardis/spectrum/tests/test_spectrum_solver.py::TestSpectrumSolver::test_initialization
  /home/riddhi/workspace/tardis-main/tardis/tardis/transport/montecarlo/montecarlo_main_loop.py:123: NumbaTypeSafetyWarning:
  
  unsafe cast from uint64 to int64. Precision may be lost.

tardis/spectrum/tests/test_spectrum_solver.py::TestSpectrumSolver::test_initialization
  /home/riddhi/workspace/tardis-main/tardis/tardis/io/util.py:289: PerformanceWarning:
  
  
  your performance may suffer as PyTables will pickle object types that it cannot
  map directly to c-types [inferred_type->mixed,key->block0_values] [items->Index([0], dtype='int64')]

tardis/spectrum/tests/test_spectrum_solver.py::TestSpectrumSolver::test_initialization
  /home/riddhi/workspace/tardis-main/tardis/tardis/io/util.py:276: PerformanceWarning:
  
  
  your performance may suffer as PyTables will pickle object types that it cannot
  map directly to c-types [inferred_type->mixed,key->block0_values] [items->Index([0], dtype='int64')]

tardis/spectrum/tests/test_spectrum_solver.py::TestSpectrumSolver::test_initialization
  /home/riddhi/workspace/tardis-main/tardis/tardis/io/util.py:292: PerformanceWarning:
  
  
  your performance may suffer as PyTables will pickle object types that it cannot
  map directly to c-types [inferred_type->mixed,key->values] [items->None]

tardis/spectrum/tests/test_spectrum_solver.py::TestSpectrumSolver::test_initialization
  /home/riddhi/workspace/tardis-main/tardis/tardis/spectrum/formal_integral.py:398: UserWarning:
  
  The number of interpolate_shells was not specified. The value was set to 80.

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================== 4 skipped, 8 warnings in 96.42s (0:01:36) ===================

Pytest stderr:

Processing commit 8/10: 73dc5352075b0db50bd8b77616c9125ce29d0fdb
Running pytest command: python -m pytest tardis/spectrum/tests/test_spectrum_solver.py --tardis-regression-data=/home/riddhi/workspace/tardis-main/tardis-regression-data --generate-reference -x
Current directory: /home/riddhi/workspace/tardis-main/tardis
Pytest stdout:
============================= test session starts ==============================
platform linux -- Python 3.12.4, pytest-8.2.2, pluggy-1.5.0
rootdir: /home/riddhi/workspace/tardis-main/tardis
configfile: pyproject.toml
plugins: anyio-4.4.0, doctestplus-1.2.1, cov-5.0.0, html-4.1.1, metadata-3.1.1
collected 4 items

tardis/spectrum/tests/test_spectrum_solver.py ssss                       [100%]

=============================== warnings summary ===============================
tardis/io/configuration/config_validator.py:6
tardis/io/configuration/config_validator.py:6
  /home/riddhi/workspace/tardis-main/tardis/tardis/io/configuration/config_validator.py:6: DeprecationWarning:
  
  jsonschema.RefResolver is deprecated as of v4.18.0, in favor of the https://github.com/python-jsonschema/referencing library, which provides more compliant referencing behavior as well as more flexible APIs for customization. A future release will remove RefResolver. Please file a feature request (on referencing) if you are missing an API for the kind of customization you need.

../../../miniforge3/envs/tardis/lib/python3.12/site-packages/jupyter_client/connect.py:22
  /home/riddhi/miniforge3/envs/tardis/lib/python3.12/site-packages/jupyter_client/connect.py:22: DeprecationWarning:
  
  Jupyter is migrating its paths to use standard platformdirs
  given by the platformdirs library.  To remove this warning and
  see the appropriate new directories, set the environment variable
  `JUPYTER_PLATFORM_DIRS=1` and then run `jupyter --paths`.
  The use of platformdirs will be the default in `jupyter_core` v6

tardis/spectrum/tests/test_spectrum_solver.py::TestSpectrumSolver::test_initialization
  /home/riddhi/workspace/tardis-main/tardis/tardis/transport/montecarlo/montecarlo_main_loop.py:123: NumbaTypeSafetyWarning:
  
  unsafe cast from uint64 to int64. Precision may be lost.

tardis/spectrum/tests/test_spectrum_solver.py::TestSpectrumSolver::test_initialization
  /home/riddhi/workspace/tardis-main/tardis/tardis/io/util.py:289: PerformanceWarning:
  
  
  your performance may suffer as PyTables will pickle object types that it cannot
  map directly to c-types [inferred_type->mixed,key->block0_values] [items->Index([0], dtype='int64')]

tardis/spectrum/tests/test_spectrum_solver.py::TestSpectrumSolver::test_initialization
  /home/riddhi/workspace/tardis-main/tardis/tardis/io/util.py:276: PerformanceWarning:
  
  
  your performance may suffer as PyTables will pickle object types that it cannot
  map directly to c-types [inferred_type->mixed,key->block0_values] [items->Index([0], dtype='int64')]

tardis/spectrum/tests/test_spectrum_solver.py::TestSpectrumSolver::test_initialization
  /home/riddhi/workspace/tardis-main/tardis/tardis/io/util.py:292: PerformanceWarning:
  
  
  your performance may suffer as PyTables will pickle object types that it cannot
  map directly to c-types [inferred_type->mixed,key->values] [items->None]

tardis/spectrum/tests/test_spectrum_solver.py::TestSpectrumSolver::test_initialization
  /home/riddhi/workspace/tardis-main/tardis/tardis/spectrum/formal_integral.py:398: UserWarning:
  
  The number of interpolate_shells was not specified. The value was set to 80.

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================== 4 skipped, 8 warnings in 93.42s (0:01:33) ===================

Pytest stderr:

Processing commit 9/10: e1b76424a28da8531af3b707d7fea4804ae81edd
Running pytest command: python -m pytest tardis/spectrum/tests/test_spectrum_solver.py --tardis-regression-data=/home/riddhi/workspace/tardis-main/tardis-regression-data --generate-reference -x
Current directory: /home/riddhi/workspace/tardis-main/tardis
Pytest stdout:
============================= test session starts ==============================
platform linux -- Python 3.12.4, pytest-8.2.2, pluggy-1.5.0
rootdir: /home/riddhi/workspace/tardis-main/tardis
configfile: pyproject.toml
plugins: anyio-4.4.0, doctestplus-1.2.1, cov-5.0.0, html-4.1.1, metadata-3.1.1
collected 4 items

tardis/spectrum/tests/test_spectrum_solver.py ssss                       [100%]

=============================== warnings summary ===============================
tardis/io/configuration/config_validator.py:6
tardis/io/configuration/config_validator.py:6
  /home/riddhi/workspace/tardis-main/tardis/tardis/io/configuration/config_validator.py:6: DeprecationWarning:
  
  jsonschema.RefResolver is deprecated as of v4.18.0, in favor of the https://github.com/python-jsonschema/referencing library, which provides more compliant referencing behavior as well as more flexible APIs for customization. A future release will remove RefResolver. Please file a feature request (on referencing) if you are missing an API for the kind of customization you need.

../../../miniforge3/envs/tardis/lib/python3.12/site-packages/jupyter_client/connect.py:22
  /home/riddhi/miniforge3/envs/tardis/lib/python3.12/site-packages/jupyter_client/connect.py:22: DeprecationWarning:
  
  Jupyter is migrating its paths to use standard platformdirs
  given by the platformdirs library.  To remove this warning and
  see the appropriate new directories, set the environment variable
  `JUPYTER_PLATFORM_DIRS=1` and then run `jupyter --paths`.
  The use of platformdirs will be the default in `jupyter_core` v6

tardis/spectrum/tests/test_spectrum_solver.py::TestSpectrumSolver::test_initialization
  /home/riddhi/workspace/tardis-main/tardis/tardis/transport/montecarlo/montecarlo_main_loop.py:123: NumbaTypeSafetyWarning:
  
  unsafe cast from uint64 to int64. Precision may be lost.

tardis/spectrum/tests/test_spectrum_solver.py::TestSpectrumSolver::test_initialization
  /home/riddhi/workspace/tardis-main/tardis/tardis/io/util.py:289: PerformanceWarning:
  
  
  your performance may suffer as PyTables will pickle object types that it cannot
  map directly to c-types [inferred_type->mixed,key->block0_values] [items->Index([0], dtype='int64')]

tardis/spectrum/tests/test_spectrum_solver.py::TestSpectrumSolver::test_initialization
  /home/riddhi/workspace/tardis-main/tardis/tardis/io/util.py:276: PerformanceWarning:
  
  
  your performance may suffer as PyTables will pickle object types that it cannot
  map directly to c-types [inferred_type->mixed,key->block0_values] [items->Index([0], dtype='int64')]

tardis/spectrum/tests/test_spectrum_solver.py::TestSpectrumSolver::test_initialization
  /home/riddhi/workspace/tardis-main/tardis/tardis/io/util.py:292: PerformanceWarning:
  
  
  your performance may suffer as PyTables will pickle object types that it cannot
  map directly to c-types [inferred_type->mixed,key->values] [items->None]

tardis/spectrum/tests/test_spectrum_solver.py::TestSpectrumSolver::test_initialization
  /home/riddhi/workspace/tardis-main/tardis/tardis/spectrum/formal_integral.py:398: UserWarning:
  
  The number of interpolate_shells was not specified. The value was set to 80.

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================== 4 skipped, 8 warnings in 93.25s (0:01:33) ===================

Pytest stderr:

Processing commit 10/10: 74b9646bf936b508817d13138805c28ed73bbd33
Running pytest command: python -m pytest tardis/spectrum/tests/test_spectrum_solver.py --tardis-regression-data=/home/riddhi/workspace/tardis-main/tardis-regression-data --generate-reference -x
Current directory: /home/riddhi/workspace/tardis-main/tardis
Pytest stdout:
============================= test session starts ==============================
platform linux -- Python 3.12.4, pytest-8.2.2, pluggy-1.5.0
rootdir: /home/riddhi/workspace/tardis-main/tardis
configfile: pyproject.toml
plugins: anyio-4.4.0, doctestplus-1.2.1, cov-5.0.0, html-4.1.1, metadata-3.1.1
collected 4 items

tardis/spectrum/tests/test_spectrum_solver.py ssss                       [100%]

=============================== warnings summary ===============================
tardis/io/configuration/config_validator.py:6
tardis/io/configuration/config_validator.py:6
  /home/riddhi/workspace/tardis-main/tardis/tardis/io/configuration/config_validator.py:6: DeprecationWarning:
  
  jsonschema.RefResolver is deprecated as of v4.18.0, in favor of the https://github.com/python-jsonschema/referencing library, which provides more compliant referencing behavior as well as more flexible APIs for customization. A future release will remove RefResolver. Please file a feature request (on referencing) if you are missing an API for the kind of customization you need.

../../../miniforge3/envs/tardis/lib/python3.12/site-packages/jupyter_client/connect.py:22
  /home/riddhi/miniforge3/envs/tardis/lib/python3.12/site-packages/jupyter_client/connect.py:22: DeprecationWarning:
  
  Jupyter is migrating its paths to use standard platformdirs
  given by the platformdirs library.  To remove this warning and
  see the appropriate new directories, set the environment variable
  `JUPYTER_PLATFORM_DIRS=1` and then run `jupyter --paths`.
  The use of platformdirs will be the default in `jupyter_core` v6

tardis/spectrum/tests/test_spectrum_solver.py::TestSpectrumSolver::test_initialization
  /home/riddhi/workspace/tardis-main/tardis/tardis/transport/montecarlo/montecarlo_main_loop.py:123: NumbaTypeSafetyWarning:
  
  unsafe cast from uint64 to int64. Precision may be lost.

tardis/spectrum/tests/test_spectrum_solver.py::TestSpectrumSolver::test_initialization
  /home/riddhi/workspace/tardis-main/tardis/tardis/io/util.py:289: PerformanceWarning:
  
  
  your performance may suffer as PyTables will pickle object types that it cannot
  map directly to c-types [inferred_type->mixed,key->block0_values] [items->Index([0], dtype='int64')]

tardis/spectrum/tests/test_spectrum_solver.py::TestSpectrumSolver::test_initialization
  /home/riddhi/workspace/tardis-main/tardis/tardis/io/util.py:276: PerformanceWarning:
  
  
  your performance may suffer as PyTables will pickle object types that it cannot
  map directly to c-types [inferred_type->mixed,key->block0_values] [items->Index([0], dtype='int64')]

tardis/spectrum/tests/test_spectrum_solver.py::TestSpectrumSolver::test_initialization
  /home/riddhi/workspace/tardis-main/tardis/tardis/io/util.py:292: PerformanceWarning:
  
  
  your performance may suffer as PyTables will pickle object types that it cannot
  map directly to c-types [inferred_type->mixed,key->values] [items->None]

tardis/spectrum/tests/test_spectrum_solver.py::TestSpectrumSolver::test_initialization
  /home/riddhi/workspace/tardis-main/tardis/tardis/spectrum/formal_integral.py:398: UserWarning:
  
  The number of interpolate_shells was not specified. The value was set to 80.

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================== 4 skipped, 8 warnings in 94.76s (0:01:34) ===================

Pytest stderr:


Processed Tardis Commits:
f5f637b4e06e3bb85f4c8163c69aede5ccfada57
5c20b5f038152d19cdfcf2ae9c384989fd518050
be54e6d0330f0f52a56a8c5e0e8ff83fb26355af
41effababbdc02ce514b957253ea0ba7a69e1b33
df376c14e57b37c62d5f5584354695faa37666cf
6f40a6002ba2bca2e1c8233319481d67ba0dbbdb
9d30f345761d2039385cb280e0d817ec09e41e5a
73dc5352075b0db50bd8b77616c9125ce29d0fdb
e1b76424a28da8531af3b707d7fea4804ae81edd
74b9646bf936b508817d13138805c28ed73bbd33

Regression Data Commits:
f8b06d56ce8182cde9f475a281f9a42b26f6dfba
a5d97a2b0cc6390e4ccf826348c170ae49ef029c
6020799e8880d742e86ba8ce5b3b073f58cb06bb
925472f1d599052b5e1cef14016bc230654f4fba
40770bf0ade19982ba43d82d7d992c97c30b64a8
599778505df3e537aeedbcfc435ecbe214caa0da
594866274ecbd9105b4f1455595b9c2a2f03fad8
a61514a230c568e4adc890930d8aa0438290e425
07bcef37f80f8b9f6eee0bbf79039e78c8074a1d
99f70e6682b6649982c159c0c0fd1d009bf8331f

Load HDF5 Data 📊¶

This code loads spectrum data from the regression repository for each processed commit. It initializes an empty list commit_data, then iterates through each regression commit to load the corresponding HDF5 data. For each commit, it checks out the commit, loads wavelength and luminosity data using load_h5_data(), and stores it in the list. After processing all commits, it resets the repository to its original state and returns to the main branch.

In [5]:
commit_data = []
regression_repo = Repo(config["regression_data_repo"])

for reg_commit in regression_commits:
    regression_repo.git.checkout(reg_commit)
    commit_data.append(load_h5_data(target_file_path, SPECTRUM_KEYS))

regression_repo.git.reset('--hard', original_head)
regression_repo.git.checkout('main')
Inspecting HDF5 file: /home/riddhi/workspace/tardis-main/tardis-regression-data/tardis/spectrum/tests/test_spectrum_solver/test_spectrum_solver/TestSpectrumSolver.h5
Top-level keys: ['simulation']
Checking simulation/spectrum_solver/spectrum_integrated
Loaded data for spectrum_integrated: wavelength shape=(10000,), luminosity shape=(10000,)
Checking simulation/spectrum_solver/spectrum_real_packets
Loaded data for spectrum_real_packets: wavelength shape=(10000,), luminosity shape=(10000,)
Checking simulation/spectrum_solver/spectrum_real_packets_reabsorbed
Loaded data for spectrum_real_packets_reabsorbed: wavelength shape=(10000,), luminosity shape=(10000,)
Checking simulation/spectrum_solver/spectrum_virtual_packets
Loaded data for spectrum_virtual_packets: wavelength shape=(10000,), luminosity shape=(10000,)

Inspecting HDF5 file: /home/riddhi/workspace/tardis-main/tardis-regression-data/tardis/spectrum/tests/test_spectrum_solver/test_spectrum_solver/TestSpectrumSolver.h5
Top-level keys: ['simulation']
Checking simulation/spectrum_solver/spectrum_integrated
Loaded data for spectrum_integrated: wavelength shape=(10000,), luminosity shape=(10000,)
Checking simulation/spectrum_solver/spectrum_real_packets
Loaded data for spectrum_real_packets: wavelength shape=(10000,), luminosity shape=(10000,)
Checking simulation/spectrum_solver/spectrum_real_packets_reabsorbed
Loaded data for spectrum_real_packets_reabsorbed: wavelength shape=(10000,), luminosity shape=(10000,)
Checking simulation/spectrum_solver/spectrum_virtual_packets
Loaded data for spectrum_virtual_packets: wavelength shape=(10000,), luminosity shape=(10000,)

Inspecting HDF5 file: /home/riddhi/workspace/tardis-main/tardis-regression-data/tardis/spectrum/tests/test_spectrum_solver/test_spectrum_solver/TestSpectrumSolver.h5
Top-level keys: ['simulation']
Checking simulation/spectrum_solver/spectrum_integrated
Loaded data for spectrum_integrated: wavelength shape=(10000,), luminosity shape=(10000,)
Checking simulation/spectrum_solver/spectrum_real_packets
Loaded data for spectrum_real_packets: wavelength shape=(10000,), luminosity shape=(10000,)
Checking simulation/spectrum_solver/spectrum_real_packets_reabsorbed
Loaded data for spectrum_real_packets_reabsorbed: wavelength shape=(10000,), luminosity shape=(10000,)
Checking simulation/spectrum_solver/spectrum_virtual_packets
Loaded data for spectrum_virtual_packets: wavelength shape=(10000,), luminosity shape=(10000,)

Inspecting HDF5 file: /home/riddhi/workspace/tardis-main/tardis-regression-data/tardis/spectrum/tests/test_spectrum_solver/test_spectrum_solver/TestSpectrumSolver.h5
Top-level keys: ['simulation']
Checking simulation/spectrum_solver/spectrum_integrated
Loaded data for spectrum_integrated: wavelength shape=(10000,), luminosity shape=(10000,)
Checking simulation/spectrum_solver/spectrum_real_packets
Loaded data for spectrum_real_packets: wavelength shape=(10000,), luminosity shape=(10000,)
Checking simulation/spectrum_solver/spectrum_real_packets_reabsorbed
Loaded data for spectrum_real_packets_reabsorbed: wavelength shape=(10000,), luminosity shape=(10000,)
Checking simulation/spectrum_solver/spectrum_virtual_packets
Loaded data for spectrum_virtual_packets: wavelength shape=(10000,), luminosity shape=(10000,)

Inspecting HDF5 file: /home/riddhi/workspace/tardis-main/tardis-regression-data/tardis/spectrum/tests/test_spectrum_solver/test_spectrum_solver/TestSpectrumSolver.h5
Top-level keys: ['simulation']
Checking simulation/spectrum_solver/spectrum_integrated
Loaded data for spectrum_integrated: wavelength shape=(10000,), luminosity shape=(10000,)
Checking simulation/spectrum_solver/spectrum_real_packets
Loaded data for spectrum_real_packets: wavelength shape=(10000,), luminosity shape=(10000,)
Checking simulation/spectrum_solver/spectrum_real_packets_reabsorbed
Loaded data for spectrum_real_packets_reabsorbed: wavelength shape=(10000,), luminosity shape=(10000,)
Checking simulation/spectrum_solver/spectrum_virtual_packets
Loaded data for spectrum_virtual_packets: wavelength shape=(10000,), luminosity shape=(10000,)

Inspecting HDF5 file: /home/riddhi/workspace/tardis-main/tardis-regression-data/tardis/spectrum/tests/test_spectrum_solver/test_spectrum_solver/TestSpectrumSolver.h5
Top-level keys: ['simulation']
Checking simulation/spectrum_solver/spectrum_integrated
Loaded data for spectrum_integrated: wavelength shape=(10000,), luminosity shape=(10000,)
Checking simulation/spectrum_solver/spectrum_real_packets
Loaded data for spectrum_real_packets: wavelength shape=(10000,), luminosity shape=(10000,)
Checking simulation/spectrum_solver/spectrum_real_packets_reabsorbed
Loaded data for spectrum_real_packets_reabsorbed: wavelength shape=(10000,), luminosity shape=(10000,)
Checking simulation/spectrum_solver/spectrum_virtual_packets
Loaded data for spectrum_virtual_packets: wavelength shape=(10000,), luminosity shape=(10000,)

Inspecting HDF5 file: /home/riddhi/workspace/tardis-main/tardis-regression-data/tardis/spectrum/tests/test_spectrum_solver/test_spectrum_solver/TestSpectrumSolver.h5
Top-level keys: ['simulation']
Checking simulation/spectrum_solver/spectrum_integrated
Loaded data for spectrum_integrated: wavelength shape=(10000,), luminosity shape=(10000,)
Checking simulation/spectrum_solver/spectrum_real_packets
Loaded data for spectrum_real_packets: wavelength shape=(10000,), luminosity shape=(10000,)
Checking simulation/spectrum_solver/spectrum_real_packets_reabsorbed
Loaded data for spectrum_real_packets_reabsorbed: wavelength shape=(10000,), luminosity shape=(10000,)
Checking simulation/spectrum_solver/spectrum_virtual_packets
Loaded data for spectrum_virtual_packets: wavelength shape=(10000,), luminosity shape=(10000,)

Inspecting HDF5 file: /home/riddhi/workspace/tardis-main/tardis-regression-data/tardis/spectrum/tests/test_spectrum_solver/test_spectrum_solver/TestSpectrumSolver.h5
Top-level keys: ['simulation']
Checking simulation/spectrum_solver/spectrum_integrated
Loaded data for spectrum_integrated: wavelength shape=(10000,), luminosity shape=(10000,)
Checking simulation/spectrum_solver/spectrum_real_packets
Loaded data for spectrum_real_packets: wavelength shape=(10000,), luminosity shape=(10000,)
Checking simulation/spectrum_solver/spectrum_real_packets_reabsorbed
Loaded data for spectrum_real_packets_reabsorbed: wavelength shape=(10000,), luminosity shape=(10000,)
Checking simulation/spectrum_solver/spectrum_virtual_packets
Loaded data for spectrum_virtual_packets: wavelength shape=(10000,), luminosity shape=(10000,)

Inspecting HDF5 file: /home/riddhi/workspace/tardis-main/tardis-regression-data/tardis/spectrum/tests/test_spectrum_solver/test_spectrum_solver/TestSpectrumSolver.h5
Top-level keys: ['simulation']
Checking simulation/spectrum_solver/spectrum_integrated
Loaded data for spectrum_integrated: wavelength shape=(10000,), luminosity shape=(10000,)
Checking simulation/spectrum_solver/spectrum_real_packets
Loaded data for spectrum_real_packets: wavelength shape=(10000,), luminosity shape=(10000,)
Checking simulation/spectrum_solver/spectrum_real_packets_reabsorbed
Loaded data for spectrum_real_packets_reabsorbed: wavelength shape=(10000,), luminosity shape=(10000,)
Checking simulation/spectrum_solver/spectrum_virtual_packets
Loaded data for spectrum_virtual_packets: wavelength shape=(10000,), luminosity shape=(10000,)

Inspecting HDF5 file: /home/riddhi/workspace/tardis-main/tardis-regression-data/tardis/spectrum/tests/test_spectrum_solver/test_spectrum_solver/TestSpectrumSolver.h5
Top-level keys: ['simulation']
Checking simulation/spectrum_solver/spectrum_integrated
Loaded data for spectrum_integrated: wavelength shape=(10000,), luminosity shape=(10000,)
Checking simulation/spectrum_solver/spectrum_real_packets
Loaded data for spectrum_real_packets: wavelength shape=(10000,), luminosity shape=(10000,)
Checking simulation/spectrum_solver/spectrum_real_packets_reabsorbed
Loaded data for spectrum_real_packets_reabsorbed: wavelength shape=(10000,), luminosity shape=(10000,)
Checking simulation/spectrum_solver/spectrum_virtual_packets
Loaded data for spectrum_virtual_packets: wavelength shape=(10000,), luminosity shape=(10000,)
Out[5]:
'Your branch and \'origin/main\' have diverged,\nand have 152 and 3 different commits each, respectively.\n  (use "git pull" if you want to integrate the remote branch with yours)'

Display Plots 📈¶

This cell creates and saves visualization plots using Plotly. It sets up a 2x2 subplot grid for spectrum analysis and generates both direct comparison and residual plots when save_plots is enabled. The plots are saved in the configured output directory as interactive HTML files.

Spectrum Plot¶

The spectrum plot shows the relationship between wavelength ($\lambda$) and luminosity ($L$) for each commit:

$$L(\lambda) = f(\lambda)$$

where:

  • $L(\lambda)$ is the luminosity at wavelength $\lambda$
  • $f(\lambda)$ represents the spectral energy distribution function

Residual Plot¶

The residual plot shows the fractional difference between spectra from different commits:

$$R(\lambda) = \frac{L_2(\lambda) - L_1(\lambda)}{L_1(\lambda)} \times 100\%$$

where:

  • $R(\lambda)$ is the residual at wavelength $\lambda$
  • $L_1(\lambda)$ is the luminosity from the reference commit
  • $L_2(\lambda)$ is the luminosity from the comparison commit
  • The result is expressed as a percentage difference

The code ensures the output directory exists before saving and handles both types of plots: luminosity vs wavelength comparisons and fractional residuals across commits.

In [6]:
fig = make_subplots(rows=2, cols=2, subplot_titles=[f'Luminosity for {key}' for key in SPECTRUM_KEYS])
fig.update_layout(height=800, showlegend=True)

if config["save_plots"]:
    os.makedirs(config["output_dir"], exist_ok=True)
    plot_all_commits_plotly(commit_data, SPECTRUM_KEYS, config["output_dir"], commit_hashes=processed_commits)
    plot_residuals_plotly(commit_data, SPECTRUM_KEYS, config["output_dir"], commit_hashes=processed_commits)
Saved Plotly plot as /home/riddhi/workspace/tardis-main/tardis/comparison_plots/all_commits_spectrum_comparison.html
Saved Plotly residual plot as /home/riddhi/workspace/tardis-main/tardis/comparison_plots/residuals_all_commits.html
In [7]:
plot_all_commits_plotly(commit_data, SPECTRUM_KEYS, config["output_dir"], commit_hashes=processed_commits)
Saved Plotly plot as /home/riddhi/workspace/tardis-main/tardis/comparison_plots/all_commits_spectrum_comparison.html
In [8]:
plot_residuals_plotly(commit_data, SPECTRUM_KEYS, config["output_dir"], commit_hashes=processed_commits)
Saved Plotly residual plot as /home/riddhi/workspace/tardis-main/tardis/comparison_plots/residuals_all_commits.html